package com.jjx.trainingapi.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.jjx.trainingapi.common.RT;
import com.jjx.trainingapi.entity.po.DcCourse;
import com.jjx.trainingapi.service.DcCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author LoveHuahua
 * @date 2022年05月23日 18:40
 * @description believe in yourself
 */
@RestController
@RequestMapping("/course")
@SaCheckLogin
public class CourseController {

    @Autowired
    DcCourseService courseService;


    /**
     * 查询所有课程
     *
     * @return
     */
    @PostMapping("/courseList")
    public RT<List<DcCourse>> getCourseList() {
        return RT.ok(courseService.list());
    }


}
